package net.mikoo.seals.common;

import java.io.FileOutputStream;
import java.io.IOException;
import java.util.UUID;

import com.alibaba.fastjson.JSONObject;

import net.glxn.qrgen.QRCode;

public class QRCodeUtils {

	
	
	public static void main(String[] args) throws IOException {

		for(int i=0 ; i < 100; i++) {
			JSONObject json = new JSONObject();
			
			json.put("code", UUID.randomUUID().toString());
			json.put("model", "v1.0.0");
			json.put("version", 0);
			json.put("productDate", "2018-09-09");
			json.put("expireDate", "2020-09-09");
			
			QRCode qrcode = QRCode.from(json.toString());
			qrcode.withSize(100, 100);
			qrcode.writeTo(new FileOutputStream("D:\\qrcode\\devices_" + i + ".png"));			
		}
    }
}
